import Vue from 'vue'
import Vuex from 'vuex'
import fetch_utils from '../utils/fetch_utils.js'
import user from './user.js'

// const file = require.context('./', false, /\.js$/)
// const modules = file.keys().reduce((temp, path) => {
//   if (path !== './index.js') {
//     temp[path.slice(2, -3)] = file(path).default
//   }
//   return temp
// }, {})
// console.log(modules);

Vue.use(Vuex)
export default new Vuex.Store({
  actions: {
    fetch (ctx, params) {
      return fetch_utils(params)
    }
  },
  modules: {
    user
  }
})